/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ScreenLayouts;

import GUI.GUIItem;
import GUI.Title;
import java.awt.Font;
import java.util.Map.Entry;
import resources.properties.Scores;
import stealth.Main;

/**
 *
 * @author Joshua
 */
public class ScoresLayout implements ScreenLayout {

    Title playerHeading, scoresHeading;
    Title[] scores, players;

    public ScoresLayout() {
        scores = new Title[10];
        players = new Title[10];
        playerHeading = new Title(Main.game.getWidth() / 3, 85, "Players", new Font("Courier", Font.BOLD, 28));
        scoresHeading = new Title((int) (2 * ((double) Main.game.getWidth() / 3)), 85, "Scores", new Font("Courier", Font.BOLD, 28));
        Scores s = Scores.getScores();
        players[0] = new Title(Main.game.getWidth() / 3 - 100, 100, (String) s.get("name1"), new Font("Courier", Font.BOLD, 26));
        scores[0] = new Title((int) (2 * ((double) Main.game.getWidth() / 3)) - 100, 100, (String) s.get("score1"), new Font("Courier", Font.BOLD, 26));

        scores[1] = new Title((int) (2 * ((double) Main.game.getWidth() / 3)) - 100, 135, (String) s.get("score2"), new Font("Courier", Font.BOLD, 26));
        players[1] = new Title(Main.game.getWidth() / 3 - 100, 135, (String) s.get("name2"), new Font("Courier", Font.BOLD, 26));

        scores[2] = new Title((int) (2 * ((double) Main.game.getWidth() / 3)) - 100, 170, (String) s.get("score3"), new Font("Courier", Font.BOLD, 26));
        players[2] = new Title(Main.game.getWidth() / 3 - 100, 170, (String) s.get("name3"), new Font("Courier", Font.BOLD, 26));

        scores[3] = new Title((int) (2 * ((double) Main.game.getWidth() / 3)) - 100, 205, (String) s.get("score4"), new Font("Courier", Font.BOLD, 26));
        players[3] = new Title(Main.game.getWidth() / 3 - 100, 205, (String) s.get("name4"), new Font("Courier", Font.BOLD, 26));

        scores[4] = new Title((int) (2 * ((double) Main.game.getWidth() / 3)) - 100, 240, (String) s.get("score5"), new Font("Courier", Font.BOLD, 26));
        players[4] = new Title(Main.game.getWidth() / 3 - 100, 240, (String) s.get("name5"), new Font("Courier", Font.BOLD, 26));

        scores[5] = new Title((int) (2 * ((double) Main.game.getWidth() / 3)) - 100, 275, (String) s.get("score5"), new Font("Courier", Font.BOLD, 26));
        players[5] = new Title(Main.game.getWidth() / 3 - 100, 275, (String) s.get("name5"), new Font("Courier", Font.BOLD, 26));

        scores[6] = new Title((int) (2 * ((double) Main.game.getWidth() / 3)) - 100, 310, (String) s.get("score6"), new Font("Courier", Font.BOLD, 26));
        players[6] = new Title(Main.game.getWidth() / 3 - 100, 310, (String) s.get("name6"), new Font("Courier", Font.BOLD, 26));

        scores[7] = new Title((int) (2 * ((double) Main.game.getWidth() / 3)) - 100, 345, (String) s.get("score7"), new Font("Courier", Font.BOLD, 26));
        players[7] = new Title(Main.game.getWidth() / 3 - 100, 345, (String) s.get("name7"), new Font("Courier", Font.BOLD, 26));

        scores[8] = new Title((int) (2 * ((double) Main.game.getWidth() / 3)) - 100, 380, (String) s.get("score8"), new Font("Courier", Font.BOLD, 26));
        players[8] = new Title(Main.game.getWidth() / 3 - 100, 380, (String) s.get("name8"), new Font("Courier", Font.BOLD, 26));

        players[9] = new Title(Main.game.getWidth() / 3 - 100, 415, (String) s.get("name9"), new Font("Courier", Font.BOLD, 26));
        scores[9] = new Title((int) (2 * ((double) Main.game.getWidth() / 3)) - 100, 415, (String) s.get("score9"), new Font("Courier", Font.BOLD, 26));
    }

    @Override
    public GUIItem[] getItems() {
        GUIItem[] items = new GUIItem[22];
        items[0] = playerHeading;
        items[1] = scoresHeading;
        System.arraycopy(players, 0, items, 2, 10);
        for (int i = 10; i< 20; i++) {
            items[i + 2] = scores[i - 10];
        }
        return items;

    }
}
